<?php
	session_start();
	
	if (!isset($_SESSION['login']) && !$_SESSION['login'] == true) {
		header ("Location: index.php");
	}

	include 'config.php';

	if(isset($_POST['ID']))
	{
		$id = $_POST['ID'];
		
		$stmt = $con->prepare('UPDATE `User` SET `Hidden` = IF(`Hidden` = 1, 0, 1), `Active` = IF(`Hidden` = 1, 0, 1) WHERE `ID` = ?');
		$stmt->bind_param('i', $id);
		$stmt->execute();
		
		//DELETES RECORD
		/*$stmt = $con->prepare('DELETE FROM `User` WHERE `ID` = ?');
		$stmt->bind_param('i', $id);
		$stmt->execute();*/

	}
	mysqli_close($con);
?>